	package charts ;
	import charts.series.Element;
	import charts.series.bars.ECandle;
	import string.Utils;

	
	class Candle extends BarBase {
		
		public function new ( json: Dynamic, group: Float ) {
			
			super( json, group );
		}
		
		//
		// called from the base object
		//
		 override function get_element( index: Int, value: Dynamic ): Element {
			
			
			var default_style: Dynamic = {
					color:		this.style.color,
					tip:		this.style.tip,
					alpha:      this.style.alpha
			};
			
			if(Std.is(value,Float))
				default_style.top = value;
			else
				ObjectHelper.merge_2( value, default_style );
				
			// our parent color is a number, but
			// we may have our own color:
			if(Std.is(default_style.color,String ))
				default_style.color = Utils.get_color( default_style.color );
				
			// tr.ace_json(default_style);
			
			return new ECandle( index, default_style, this.group );
		}
	}
